package com.carkeeper.service.serviceFallback;

import com.carkeeper.dto.CarDTO;
import com.carkeeper.service.CarFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

/**
 * 车辆信息-微服务接口Fallback
 */
@Component
public class CarFallbackFactory implements FallbackFactory<CarFeign> {
    @Override
    public CarFeign create(Throwable throwable) {
        return new CarFeign() {
            @Override
            public CarDTO findById(Long id) {
                return null;
            }

            @Override
            public List<CarDTO> findAll(CarDTO dto) {
                return new ArrayList<>();
            }

            @Override
            public CarDTO findByCode(CarDTO dto) {
                return null;
            }
        };
    }
}
